package my.action.article;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import my.controller.Action;
import my.controller.ActionForward;
import my.db.DAO.ArticleDAO;
import my.db.DAO.AuthorDAO;
import my.db.DTO.ArticleDTO;
import my.db.DTO.AuthorDTO;
public class ArticleListAction implements  Action{
	 public ActionForward execute(HttpServletRequest request,HttpServletResponse response) throws Exception{
		   
		 	ArrayList<ArticleDTO> list_au=new ArrayList<ArticleDTO>();
			ActionForward forward=new ActionForward();
		    ArticleDAO adao=new ArticleDAO();
		 	HttpSession session=request.getSession(true);
		 	int id=(int) session.getAttribute("userid");
		    ArrayList<ArticleDTO> lst_art=adao.getArticleAuthor(id);
			request.setAttribute("list_article", lst_art);
			forward.setPath("./author_page.jsp");
			forward.setRedirect(false);
			return forward;
		}  	
}